function [llinea, llinem, llinel, llineg, llinet, llined] = doallVideo(image)

%% perform edge detection and RANSAC line fitting on left and right images
rand('state',300)

% find edges - use canny
imageDim=image;

imshow(imageDim);
%Finds all the edges in the image using the canny edge detector
imageEdges = edge(imageDim,'canny',[0.01,0.1],3);

[lr,lc] = find(imageEdges==1);

% plot edges from left image

figure(1)
plot(lc,lr,'k.')
title('image edges')
axis([0 640 0 480])
axis ij
  
%Plot the edges in the image
figure(4)
clf
plot(lc,lr,'k.')
axis([0 640 0 480])
axis ij
hold on
  
  flag = 1;
  %The edges for the left image
  sr = lr;
  sc = lc;
  llinecount = 0;
  llinea = zeros(100,2);
  llinem = zeros(100,2);
  llinel = zeros(100,1);
  llineg = zeros(100,1);
  llinet = zeros(100,1);
  llined = zeros(100,1);
  while flag == 1
      %Finds a single ransac line. Returns the points t and d used
      %to draw the line in the image
    [flag,t,d,nr,nc,count,frl,fcl,newcountl] = ransacline(sr,sc,2,0.1,0.01,0.001,40,3);
    if flag == 1 & newcountl > 0 
      pointsleft = size(nr);
      
      %The edge points not used for the line
      sr = nr;
      sc = nc;
      llinecount = llinecount+1;
      %describe segment with point list ir and ic, returning
       %direction a, midpoint m, length l and average contrast g
      [llinea(llinecount,:),llinem(llinecount,:),llinel(llinecount), ...
            llineg(llinecount)] = descrseg(frl,fcl,imageDim,4);
      llinet(llinecount) = t;
      llined(llinecount) = d;
      
       [cr,cc] = plotline(t,d);
       %figure(3)
        %plot(cc,cr)
        figure(4)
        plot(cc,cr)
        title('overlay of left image lines - from RANSAC')
        pause(0.5)    
    end
  end
  
  %% remove semi-colons on following lines to see printout of right lines

  
llinea(1:llinecount,:);
llinem(1:llinecount,:);
llinel(1:llinecount);
llineg(1:llinecount);
llinet(1:llinecount);
llined(1:llinecount);
['image processed - RANSAC lines found']
